Modern micro electronic technologies allow for the mass production of three-axis magnetometers for measuring three projections of a magnetic field vector onto three mutually-perpendicular axes. Such three-dimensional sensors are produced both as separate magnetic sensor chips and as chip-scale dies for integration into a System-on-Chip (SoC) together with other electronic sensors (e.g., 3D-accelerometers, 3D-gyros, and the like), data processing devices and/or interface units. As will be appreciated, these types of three-axis magnetometers are widely used as navigation and device attitude sensors in mobile electronic devices such as smartphones, tablets, and the like.
A three-axis magnetometer (also referred to herein as a “3D-magnetometer) is typically mounted to or in an electronic device on the housing of the electronic device or installed onto a printed circuit board (PCB) rigidly fixed within the housing of the device. For both mountings, sensitivity axes of the magnetometer have a fixed orientation relative to the housing thereby allowing for a determination of orthogonal projections of the magnetic field vector and the orientation of the device housing relative to the magnetic field vector.
However, 3D-magnetometer measurements are not enough for determination of the full spatial orientation of the device housing, since any random housing rotation about the magnetic field vector of an external magnetic field does not change the vector projections on the magnetometer sensitivity axes. As such, to determine full orientation of the housing, one needs to measure three orthogonal projections of another permanent vector that is non-collinear to the magnetic field vector at a given point. For example, a free falling acceleration vector is one such vector for a stationary electronic device. Using such a free falling acceleration vector, vector components are measured by a 3D-accelerometer in the form of a specific acceleration vector directed to the opposite direction relative to the free falling acceleration vector. By co-processing measurements of the 3D-magnetometer and 3D-accelerometer one is able to unambiguously define a spatial orientation of the device housing for most areas of the Earth excluding areas close to the North and South Celestial Poles. In the vicinity of these Celestial Poles the condition of non-collinearity of the specific acceleration vector and magnetic field is violated, and such co-processing fails to uniquely orient the device to achieve the desired calibration, for example.
The magnetic field inside the electronic device is different from the natural magnetic field of the Earth. Magnetic field distortions in the housing generally fall into two main categories. The first distortion type is caused by an additional magnetic field from constant magnets, direct current circuits, and/or any magnetized elements in the device. This distortion type is a so-called “hard iron” error and produces a constant addition to the 3D-magnetometer measurements, and such hard iron errors do not disappear when the external magnetic field(s) disappear.
The second error distortion type relates to magnetic-sensitive structure elements whose magnetization is determined by the magnitude and direction of the applied magnetic field. This applied field is the sum of the Earth's magnetic field and the hard iron magnetic field. These structural elements, under the influence of the applied magnetic field, create their own additional magnetic field which is linear to the vector of the applied magnetic field. As such, the vector of the created field is added to the magnetic vector of the applied field and the sum vector measured by the magnetometer is different from the external field vector in both magnitude and direction. Such errors are so-called “soft iron” errors, and disappear when the applied magnetic field(s) disappear.
Thus, the three-axis magnetometer inside an electronic device measures various components of a complex magnetic field including but not limited to the Earth's magnetic field and magnetic fields of direct currents distorted by magnetic-sensitive structural elements rather than vector components of the Earth's natural magnetic field. Such a complex combination of magnetic fields considerably distorts the relatively weak natural Earth's magnetic field and makes it impossible to directly determine a magnetic direction for a device on the basis of magnetometer raw measurements.
The distortion of the magnitude and direction of the Earth's magnetic field vector is not only due to structural components but also due to the 3D-magnetometer itself which may introduce measurement errors. In fact, the uniaxial sensitive element of the 3D magnetometer converts the magnetic field projection first to an electric signal and then to a digital code. In the simplest case such a conversion can be presented as a multiplication operation of the measured projection by a scaling factor and the addition of a constant zero-offset to the multiplication result. Ideally, the scaling factors are equal, and zero-offsets should be zero for all sensitive elements of the 3D-magnetometer. But, due to a plurality of random factors and permissible errors in industrial production of magnetometers, actual scaling factors and offsets have non-systematic variations from ideal values. Manufacturing errors can also cause a random distortion of a magnetometer's sensor frame, that is, actual directions of single sensitivity axes do not form an orthogonal sensor frame.
Measuring inaccuracies (e.g., scaling factors variations, non-zero offsets and distortions of measuring bases) can be similarly described in 3D-accelerometers and 3D-gyroscopes. A combination of these factors results in systematic errors in vector measurements, that is, projections of the magnetic field vector for 3D-magnetometers, projections of the specific acceleration vector for 3D-accelerometers and projections of the angular rate vector for 3D-gyros.
Measurements of the integrated 3D-magnetometer to determine the device's magnetic heading and attitude are possible only after correcting all systematic errors and isolating the components corresponding to the Earth's magnetic vector from the corrected measurements. To do this, systematic errors in sensors and any magnetic parasitic components inside the electronic device should be determined. A simple solution can be a laboratory calibration of the magnetometer as a part of the integrated device. But parameters of chip-scale magnetometers and internal magnetic field change in time. In addition, such calibration in mass production of electronic devices can considerably exceed the cost of the chip-scale magnetometer itself. Therefore, laboratory calibration is typically not a reasonable solution for chip-scale magnetometers.
Alternatively, there are a number of other known calibration techniques for a magnetometer integrated in an electronic device having simultaneous measurements from inertial sensors. For example, U.S. Pat. No. 7,451,549 to R. Sodhi et al. discloses recurrent calibration algorithms for soft and hard iron magnetometer errors through the co-processing of 3D-magnetometer and 3D-accelerometer data. To build an analytical model for soft and hard iron errors, raw magnetometer data are approximated by a three-dimensional ellipsoid. A general theory for such an approximation is described in, for example, A. R., Shuster M. D. “Complete Linear Attitude-Independent Magnetometer Calibration”, The Journal of Astronautical Science, Vol. 50, No. 4, October-December 2002, pp. 477-490 (hereinafter “Shuster”), and I. Markovsky, A. Kukush, S. Van Huffel “Consistent Least Squares Fitting of Ellipsoids”, Numer. Math. (2004) 98: 177-194 (hereinafter “Markovsky”). Joint processing is based on the assumption of constancy for a dot product of the Earth's magnetic field vector and gravity field vector, measured by the 3D-magnetometer and 3D-accelerometer, respectively, during calibration rotations of the electronic device. This technique fails when the device under calibration undergoes translational accelerations during calibration rotations. These accelerations are unavoidable during hand-made rotations of the device housing. These accelerations are measured by the 3D accelerometer as a spurious additive vector to the gravity field vector and which violate the dot product constancy condition.
U.S. Pat. No. 8,717,009 to X. Tu describes a calibration of soft and hard iron magnetometer errors due to the recurrent comparison of magnetometer raw vector measurements and reference measurements calculated from an immediate device orientation and previous magnetic heading estimation. This comparison is based on the well-known Kalman filter. In this way, an angular rate sensor serves as an orientation sensor. This technique fails because of the state vector recurrent Kalman filter contains an incomplete list of parameters for soft and hard error calibration. This state vector contains only three parameters for soft iron error calibration. However, a complete list of parameters requires nine parameters for soft iron error calibration.
United States Patent Publication No. 2013/0238268 to H. Sheng describes a technique for magnetometer calibration without additional measurements from inertial sensors. To build an analytical model for soft and hard iron errors, raw magnetometer data are approximated by a three-dimensional ellipsoid. Matrices for calculating calibrated parameters are stored by a recurrent method, and the algorithm produces a full calibration of hard iron errors, while soft iron errors calibration is performed to the accuracy of an arbitrary orthogonal matrix, which will be unknown after the completion of calibration. This uncertainty of the orthogonal part of the soft iron matrix provides completely unknown error in a magnetometer's measurements transformation and the following device attitude determination. As such, this technique fails without application of additional information about the orthogonal matrix.
United States Patent Publication No. 2013/0320963 to C. Tennessee et al. describes a technique for determining continuous zero-offsets in magnetometer measurements based on comparing the tilt angle of the magnet intensity vector measured by the magnetometer and the housing rotation angle obtained by integrating angular rate components measured by a 3D-gyro between subsequent instants of reading magnetometer samples. This technique fails because of hard iron errors are only determined but soft iron errors remain undetermined.
United States Patent Publication No. 2015/0019159 to M. Elgersma et al. describes a technique for a recurrent calibration of a magnetometer, a task of position and orientation determination for an electronic device due to co-processing measurements from the magnetometer and Inertial Measurement Unit (IMU), the latter having a 3D-accelerometer and 3D-gyro. Device orientation is calculated in a navigation coupling filter based on IMU measurements is used for a continuous determination of parameters for soft and hard iron magnetometer errors. The obtained parameters are applied to correct the magnetometer raw measurements, and the magnetic heading is provided as input to the coupling filter as a correction signal. The position computed in the coupling filter is entered into the Earth's magnetic field model to calculate a reference vector of magnetic intensity used in magnetometer calibration. This technique utilizes a the closed-loop architecture, which requires a continuous determination of the device's instant attitude, which is used for continuous magnetometer calibration during the entire interval of device operation. The magnetometer calibration results in turn are used for the continuous attitude determination of the device.
As mentioned above, the above-described techniques have certain inefficiencies with respect to magnetometer calibration, for example, including but not limited to not determining an entire the set of soft iron matrix coefficients, and/or requiring the translational acceleration to be zero and/or requiring a continuous spatial attitude determination of the device.
Therefore, a need exists for an improved technique for calibrating three-axis magnetometers integrated within electronic devices.